<template>
  <div id="app">
    <div class="main">
      <!--导航栏-->
      <div class="header">
        <Header></Header>
      </div>
      <div class="nav">
        <Nav></Nav>
      </div>
      <div class="content" style="width: 100%;">
        <div class="main_content" style="height: 1300px;width: 1200px;margin: auto; ">
            <!--头部标签-->
          <div class="nav_top">

            <div class="w850 fl" style="height: 90px;width: 800px;background-color: #fcfcfc;border: 1px solid #EAEEED; ">
              <div class="list-select-wrap mb15">
                <dl class="clearfix">
                  <dt><span>大类 :</span></dt>
                  <dd class="clearfix">
                    <a href="/" class="active">全部</a>
                    <ul><a href="/">语言·留学</a>
                      <a href="/">婴幼儿教育</a>
                    </ul>
                    <ul><a href="/">基础教育</a>
                      <a href="/">学历教育</a>
                    </ul>
                    <ul><a href="/">资格考试</a>
                      <a href="/">职业技能</a>
                    </ul>
                    <ul><a href="/">IT培训</a>
                      <a href="/">管理培训</a>
                    </ul>
                    <ul><a href="/">兴趣/素养</a>
                      <a href="/">文体艺术</a>
                    </ul>
                    <ul><a href="/">餐饮培训</a>
                    </ul>
                  </dd>
                </dl>
              </div>
            </div>

          </div>

          <!--侧边栏-->
          <div class="right_content" style="float: right;margin-top: 20px;width: 330px;border: 1px solid #EAEEED;">
            <div class="bg1 hot-news p20 mb20" >
              <div class="title"><b>热门新闻</b></div>
              <ul >
                <li>
                  <p class="text-title"><a title="淮南怎么考园长证要怎么考需要哪些资料科目介绍" href="/" target="_blank">淮南怎么考园长证要怎么考需要哪些资料科目介绍</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-18</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="！《2021海归人才发展报告》：用大数据读懂留学和就业！" href="/" target="_blank">！《2021海归人才发展报告》：用大数据读懂留学和就业！</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="沈阳微整培训学多久" href="/" target="_blank">沈阳微整培训学多久</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="铜陵叉车司机证报考捷径报名时间加上证书报名费多少钱真心诚信" href="/" target="_blank">铜陵叉车司机证报考捷径报名时间加上证书报名费多少钱真心诚信</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="淮北叉车证哪里考网上报考并且叉车司机驾驶证报名点个人报名" href="/" target="_blank">淮北叉车证哪里考网上报考并且叉车司机驾驶证报名点个人报名</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="马鞍山叉车证报考流程哪里考然后报考证书有补贴吗诚信经营" href="/" target="_blank">马鞍山叉车证报考流程哪里考然后报考证书有补贴吗诚信经营</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="合肥叉车证考什么考试地点连同证书复审在哪报考用心做事" href="/" target="_blank">合肥叉车证考什么考试地点连同证书复审在哪报考用心做事</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="哈尔滨微整培训学校好吗" href="/" target="_blank">哈尔滨微整培训学校好吗</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="安徽叉车证报名时间哪里考加以想学证书哪里报名哪里可以考" href="/" target="_blank">安徽叉车证报名时间哪里考加以想学证书哪里报名哪里可以考</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
                <li>
                  <p class="text-title"><a title="漳州叉车证在哪报名报考手续然后证书年审需要什么资料报考指南" href="/" target="_blank">漳州叉车证在哪报名报考手续然后证书年审需要什么资料报考指南</a></p>
                  <div class="info">
                    <p class="author"><span class="time">2021-11-12</span></p>
                  </div>
                </li>
              </ul>
            </div>
          </div>

            <!--主内容-->
            <div class="main_content" style="margin-top: 20px;float: left">
              <ul class="news-list-01" v-for="(item,index) in tableData">
                <li style="border: 1px solid #EAEEED;width: 800px">
                  <a href="/" target="_blank">
                    <span><img :src="'static/News_img/'+item.img" alt="淮南怎么考园长证要怎么考需要哪些资料科目介绍"></span>
                    <div>
                      <b>{{item.title}}</b>
                      <p>{{item.name}}</p>
                      <div><span>{{item.time}}</span><span>{{item.look}}人浏览</span></div>
                    </div>
                  </a>
                </li>
              </ul>
            </div>
        </div>
        <!--分页-->
        <div style="margin-left: 150px;margin-bottom: 30px">
          <el-pagination
            layout="prev, pager, next"
            :total="50">
          </el-pagination>
        </div>


      </div>
      <!--底部-->
      <div class="footer">
        <Footer></Footer>
      </div>
    </div>
  </div>
</template>
<script>
  import Header from "../components/Header";
  import Footer from "../components/Footer";
  import Nav from "../components/Nav";
  export default {
    name: "Index",
    data(){
      return{
        currentPage:1, //初始页
        pageSize:5,    //每页的数据
        tableData:[{}],
      }
    },
    methods:{
      // 初始页currentPage、初始每页数据数pagesize和数据data
      handleSizeChange: function (size) {
        this.pagesize = size;
        console.log(this.pagesize)  //每页下拉显示数据
      },
      handleCurrentChange: function(currentPage){
        this.currentPage = currentPage;
        console.log(this.currentPage)  //点击第几页
      },
      /*查询所有资讯*/
      findAll(){
        let _this = this
        this.$axios.get("http://localhost:8066/news/getNews").then(function(res){
          _this.tableData = res.data
          console.log(res.data)
        }).catch(function (err) {
          alert('查询失败')
        })
      },

    },
    components:{
      Footer,
      Header,
      Nav
    },
    //初始化阶段 brforeCreate 内部事件 生命周期
    created(){
      this.findAll();
    }
  }
</script>
<style scoped>


  .news-list-01 {
    box-sizing: border-box;
  }

  .news-list-01 li {
    margin-bottom: 15px;
  }

  .news-list-01 li a {
    display: block;
    padding: 20px;
    height: 168px;
    background-color: #ffffff;
    transition: all .2s;
  }
  a {
    text-decoration: none;
    color: #666666;
  }

  .news-list-01 li a > span {
    width: 260px;
    height: 168px;
    overflow: hidden;
    margin-right: 20px;
    float: left;
  }

  .news-list-01 li a > span img {
    display: block;
    width: 260px;
    height: 168px;
    position: relative;
    z-index: 0;
    transition: all .2s;
  }

  .news-list-01 li a > div b {
    font-size: 18px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 10px;
  }

  .news-list-01 li a > div p {
    line-height: 24px;
    height: 72px;
    font-size: 14px;
    color: #666666;
    margin-bottom: 20px;
  }

  .news-list-01 li a > div div span {
    padding-right: 20px;
  }

  .news-list-01 li a > div div span {
    padding-right: 20px;
  }

  .mb20 {
    margin-bottom: 20px;
  }
  .p20 {
    padding: 20px;
  }
  .hot-news .title {
    margin-bottom: 20px;
  }

  .title b {
    display: inline-block;
    font-size: 17px;
    height: 17px;
    line-height: 17px;
    border-left: 3px #ff8900 solid;
    padding-left: 10px;
    font-weight: 400;
  }


  .hot-news li {
    border-top: 1px #f4f4f4 solid;
    padding: 20px 0;
  }

  .text-title a{
    font-size: 15px;
  }

  .hot-news .text-title {
    font-size: 20px;
    font-weight: 400;
  }

  a {
    text-decoration: none;
    color: #666666;
  }

  .hot-news .info {
    padding-top: 10px;
    color: #999;
    line-height: 18px;
    font-size: 14px;
    overflow: hidden;
  }

  .hot-news .info .author {
    float: right;
  }



  .fl {
    float: left;
  }

  .w850 {
    width: 850px;
  }

  .mb15 {

    margin-bottom: 15px;
  }


  .clearfix {
    zoom: 1;
  }

  .list-select-wrap dt {
    color: #444444;
    width: 100px;
    text-align: right;
    float: left;
  }

  .list-select-wrap dt span {
    display: block;
    margin: 5px 10px;
    font-weight: bold;
    padding: 2px 0;
  }

  .list-select-wrap span, .list-select-wrap a {
    font-size: 13px;
    color: #666666;
    line-height: 22px;
  }
  .list-select-wrap dd {
    padding-left: 100px;
  }

  .clearfix {
    zoom: 1;
  }

  .list-select-wrap dd a:hover, .list-select-wrap .active {
    background-color: #00A57F;
    border-radius: 3px;
    color: #ffffff;
  }
  .list-select-wrap dd a {
    float: left;
    margin: 5px 2px;
    padding: 2px 8px;
    transition: all .2s;
  }

  .list-select-wrap span, .list-select-wrap a {
    font-size: 13px;
    line-height: 22px;
  }
  a {
    text-decoration: none;
  }

  ol, ul, li {
    list-style: none outside none;
    margin: 0;
    padding: 0;
  }

  .list-select-wrap dd a {
    float: left;
    margin: 5px 2px;
    padding: 2px 8px;
    transition: all .2s;
  }
  .list-select-wrap span, .list-select-wrap a {
    font-size: 13px;
    color: #666666;
    line-height: 22px;
  }
</style>

